﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class ImageEx
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class ImageEx
   ">
    <meta name="generator" content="docfx 2.48.0.0">
    
    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="../../apicatlog/toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../../index.html">
                <img id="logo" class="svg" src="../../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="WQLAPI.Extensions.ImageEx">
  
  
  <h1 id="WQLAPI_Extensions_ImageEx" data-uid="WQLAPI.Extensions.ImageEx" class="text-break">Class ImageEx
  </h1>
  <div class="markdown level0 summary"><p>图像扩展类</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">ImageEx</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="WQLAPI.Extensions.html">WQLAPI.Extensions</a></h6>
  <h6><strong>Assembly</strong>: WQLAPI.dll</h6>
  <h5 id="WQLAPI_Extensions_ImageEx_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class ImageEx</code></pre>
  </div>
  <h3 id="methods">Methods
  </h3>
  
  
  <a id="WQLAPI_Extensions_ImageEx_Bounds_" data-uid="WQLAPI.Extensions.ImageEx.Bounds*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_Bounds_System_Drawing_Image_" data-uid="WQLAPI.Extensions.ImageEx.Bounds(System.Drawing.Image)">Bounds(Image)</h4>
  <div class="markdown level1 summary"><p>Gets the bounds of the image in pixels</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Rectangle Bounds(this Image image)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><span class="parametername">image</span></td>
        <td><p>Instance value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Rectangle</span></td>
        <td><p>A rectangle that has the same height and width as given image.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_FileToBytes_" data-uid="WQLAPI.Extensions.ImageEx.FileToBytes*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_FileToBytes_System_String_" data-uid="WQLAPI.Extensions.ImageEx.FileToBytes(System.String)">FileToBytes(String)</h4>
  <div class="markdown level1 summary"><p>文件转换为Byte数组</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static byte[] FileToBytes(this string filename)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">filename</span></td>
        <td><p>文件名</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Byte</span>[]</td>
        <td><p>结果</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_GetImageFromUrl_" data-uid="WQLAPI.Extensions.ImageEx.GetImageFromUrl*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_GetImageFromUrl_System_String_" data-uid="WQLAPI.Extensions.ImageEx.GetImageFromUrl(System.String)">GetImageFromUrl(String)</h4>
  <div class="markdown level1 summary"><p>从URL获取图像</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Image GetImageFromUrl(string url)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">url</span></td>
        <td><p>URL</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><p>Image</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_Graphics_" data-uid="WQLAPI.Extensions.ImageEx.Graphics*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_Graphics_System_Drawing_Image_" data-uid="WQLAPI.Extensions.ImageEx.Graphics(System.Drawing.Image)">Graphics(Image)</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Graphics Graphics(this Image image)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><span class="parametername">image</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Graphics</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_HorizontalFlip_" data-uid="WQLAPI.Extensions.ImageEx.HorizontalFlip*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_HorizontalFlip_System_Drawing_Bitmap_" data-uid="WQLAPI.Extensions.ImageEx.HorizontalFlip(System.Drawing.Bitmap)">HorizontalFlip(Bitmap)</h4>
  <div class="markdown level1 summary"><p>图像水平翻转</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap HorizontalFlip(this Bitmap image)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">image</span></td>
        <td><p>原来图像</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_IsNullOrEmpty_" data-uid="WQLAPI.Extensions.ImageEx.IsNullOrEmpty*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_IsNullOrEmpty_System_Drawing_Color_" data-uid="WQLAPI.Extensions.ImageEx.IsNullOrEmpty(System.Drawing.Color)">IsNullOrEmpty(Color)</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool IsNullOrEmpty(this Color color)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Color</span></td>
        <td><span class="parametername">color</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_IsValid_" data-uid="WQLAPI.Extensions.ImageEx.IsValid*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_IsValid_System_Drawing_Color_" data-uid="WQLAPI.Extensions.ImageEx.IsValid(System.Drawing.Color)">IsValid(Color)</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool IsValid(this Color color)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Color</span></td>
        <td><span class="parametername">color</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_ResizeImage_" data-uid="WQLAPI.Extensions.ImageEx.ResizeImage*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ResizeImage_System_Drawing_Bitmap_System_Int32_System_Int32_" data-uid="WQLAPI.Extensions.ImageEx.ResizeImage(System.Drawing.Bitmap,System.Int32,System.Int32)">ResizeImage(Bitmap, Int32, Int32)</h4>
  <div class="markdown level1 summary"><p>缩放图像</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap ResizeImage(this Bitmap bmp, int newW, int newH)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">bmp</span></td>
        <td><p>原图片</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">newW</span></td>
        <td><p>宽度</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">newH</span></td>
        <td><p>高度</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><p>新图片</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_Rotate_" data-uid="WQLAPI.Extensions.ImageEx.Rotate*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_Rotate_System_Drawing_Bitmap_System_Single_System_Drawing_Color_" data-uid="WQLAPI.Extensions.ImageEx.Rotate(System.Drawing.Bitmap,System.Single,System.Drawing.Color)">Rotate(Bitmap, Single, Color)</h4>
  <div class="markdown level1 summary"><p>旋转图片</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap Rotate(this Bitmap bmp, float angle, Color bkColor)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">bmp</span></td>
        <td><p>图片</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">angle</span></td>
        <td><p>角度</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Drawing.Color</span></td>
        <td><span class="parametername">bkColor</span></td>
        <td><p>背景色</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><p>图片</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_RotateAngle_" data-uid="WQLAPI.Extensions.ImageEx.RotateAngle*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_RotateAngle_System_Drawing_Image_System_Single_" data-uid="WQLAPI.Extensions.ImageEx.RotateAngle(System.Drawing.Image,System.Single)">RotateAngle(Image, Single)</h4>
  <div class="markdown level1 summary"><p>旋转图片</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap RotateAngle(this Image image, float angle)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><span class="parametername">image</span></td>
        <td><p>图片</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">angle</span></td>
        <td><p>角度</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><p>图片</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_ScaleToSize_" data-uid="WQLAPI.Extensions.ImageEx.ScaleToSize*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ScaleToSize_System_Drawing_Bitmap_System_Drawing_Size_" data-uid="WQLAPI.Extensions.ImageEx.ScaleToSize(System.Drawing.Bitmap,System.Drawing.Size)">ScaleToSize(Bitmap, Size)</h4>
  <div class="markdown level1 summary"><p>Scales the bitmap to the passed target size without respecting the aspect.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap ScaleToSize(this Bitmap bitmap, Size size)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">bitmap</span></td>
        <td><p>The source bitmap.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Drawing.Size</span></td>
        <td><span class="parametername">size</span></td>
        <td><p>The target size.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><p>The scaled bitmap</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="WQLAPI_Extensions_ImageEx_ScaleToSize_System_Drawing_Bitmap_System_Drawing_Size__examples">Examples</h5>
  <pre><code>	var bitmap = new Bitmap(&quot;image.png&quot;);
	var thumbnail = bitmap.ScaleToSize(100, 100);</code></pre>

  
  
  <a id="WQLAPI_Extensions_ImageEx_ScaleToSize_" data-uid="WQLAPI.Extensions.ImageEx.ScaleToSize*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ScaleToSize_System_Drawing_Bitmap_System_Int32_System_Int32_" data-uid="WQLAPI.Extensions.ImageEx.ScaleToSize(System.Drawing.Bitmap,System.Int32,System.Int32)">ScaleToSize(Bitmap, Int32, Int32)</h4>
  <div class="markdown level1 summary"><p>Scales the bitmap to the passed target size without respecting the aspect.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap ScaleToSize(this Bitmap bitmap, int width, int height)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">bitmap</span></td>
        <td><p>The source bitmap.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">width</span></td>
        <td><p>The target width.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">height</span></td>
        <td><p>The target height.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><p>The scaled bitmap</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="WQLAPI_Extensions_ImageEx_ScaleToSize_System_Drawing_Bitmap_System_Int32_System_Int32__examples">Examples</h5>
  <pre><code>	var bitmap = new Bitmap(&quot;image.png&quot;);
	var thumbnail = bitmap.ScaleToSize(100, 100);</code></pre>

  
  
  <a id="WQLAPI_Extensions_ImageEx_SetDefaultQuality_" data-uid="WQLAPI.Extensions.ImageEx.SetDefaultQuality*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_SetDefaultQuality_System_Drawing_Graphics_" data-uid="WQLAPI.Extensions.ImageEx.SetDefaultQuality(System.Drawing.Graphics)">SetDefaultQuality(Graphics)</h4>
  <div class="markdown level1 summary"><p>设置GDI默认值</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SetDefaultQuality(this Graphics g)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Graphics</span></td>
        <td><span class="parametername">g</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_SetHighQuality_" data-uid="WQLAPI.Extensions.ImageEx.SetHighQuality*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_SetHighQuality_System_Drawing_Graphics_" data-uid="WQLAPI.Extensions.ImageEx.SetHighQuality(System.Drawing.Graphics)">SetHighQuality(Graphics)</h4>
  <div class="markdown level1 summary"><p>设置GDI高质量模式抗锯齿</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void SetHighQuality(this Graphics g)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Graphics</span></td>
        <td><span class="parametername">g</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_Split_" data-uid="WQLAPI.Extensions.ImageEx.Split*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_Split_System_Drawing_Bitmap_System_Drawing_Drawing2D_GraphicsPath_" data-uid="WQLAPI.Extensions.ImageEx.Split(System.Drawing.Bitmap,System.Drawing.Drawing2D.GraphicsPath)">Split(Bitmap, GraphicsPath)</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap Split(this Bitmap image, GraphicsPath path)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">image</span></td>
        <td></td>
      </tr>
      <tr>
        <td><span class="xref">System.Drawing.Drawing2D.GraphicsPath</span></td>
        <td><span class="parametername">path</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_Split_" data-uid="WQLAPI.Extensions.ImageEx.Split*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_Split_System_Drawing_Bitmap_System_Int32_WQLAPI_Extensions_UIShape_" data-uid="WQLAPI.Extensions.ImageEx.Split(System.Drawing.Bitmap,System.Int32,WQLAPI.Extensions.UIShape)">Split(Bitmap, Int32, UIShape)</h4>
  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap Split(this Bitmap image, int size, UIShape shape)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">image</span></td>
        <td></td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">size</span></td>
        <td></td>
      </tr>
      <tr>
        <td><a class="xref" href="WQLAPI.Extensions.UIShape.html">UIShape</a></td>
        <td><span class="parametername">shape</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_StepColor_" data-uid="WQLAPI.Extensions.ImageEx.StepColor*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_StepColor_System_Drawing_Color_System_Int32_" data-uid="WQLAPI.Extensions.ImageEx.StepColor(System.Drawing.Color,System.Int32)">StepColor(Color, Int32)</h4>
  <div class="markdown level1 summary"><p>设置递进颜色</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Color StepColor(this Color color, int alpha)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Color</span></td>
        <td><span class="parametername">color</span></td>
        <td><p>颜色</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">alpha</span></td>
        <td><p>alpha</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Color</span></td>
        <td><p>颜色</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_Surround_" data-uid="WQLAPI.Extensions.ImageEx.Surround*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_Surround_System_Drawing_Point_System_Int32_" data-uid="WQLAPI.Extensions.ImageEx.Surround(System.Drawing.Point,System.Int32)">Surround(Point, Int32)</h4>
  <div class="markdown level1 summary"><p>Gets the rectangle that surrounds the given point by a specified distance.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Rectangle Surround(this Point p, int distance)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Point</span></td>
        <td><span class="parametername">p</span></td>
        <td><p>Instance value.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">distance</span></td>
        <td><p>Distance that will be used to surround the point.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Rectangle</span></td>
        <td><p>Rectangle that surrounds the given point by a specified distance.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_ToBytes_" data-uid="WQLAPI.Extensions.ImageEx.ToBytes*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ToBytes_System_Drawing_Image_System_Drawing_Imaging_ImageFormat_" data-uid="WQLAPI.Extensions.ImageEx.ToBytes(System.Drawing.Image,System.Drawing.Imaging.ImageFormat)">ToBytes(Image, ImageFormat)</h4>
  <div class="markdown level1 summary"><p>Serializes the image in an byte array</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static byte[] ToBytes(this Image image, ImageFormat format)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><span class="parametername">image</span></td>
        <td><p>Instance value.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Drawing.Imaging.ImageFormat</span></td>
        <td><span class="parametername">format</span></td>
        <td><p>Specifies the format of the image.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Byte</span>[]</td>
        <td><p>The image serialized as byte array.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_ToFile_" data-uid="WQLAPI.Extensions.ImageEx.ToFile*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ToFile_System_Byte___System_String_" data-uid="WQLAPI.Extensions.ImageEx.ToFile(System.Byte[],System.String)">ToFile(Byte[], String)</h4>
  <div class="markdown level1 summary"><p>Byte数组保存为文件</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void ToFile(this byte[] bytes, string filename)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Byte</span>[]</td>
        <td><span class="parametername">bytes</span></td>
        <td><p>bytes</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">filename</span></td>
        <td><p>文件名</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_ToIcon_" data-uid="WQLAPI.Extensions.ImageEx.ToIcon*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ToIcon_System_Drawing_Image_" data-uid="WQLAPI.Extensions.ImageEx.ToIcon(System.Drawing.Image)">ToIcon(Image)</h4>
  <div class="markdown level1 summary"><p>转换Image为Icon
<a href="https://www.cnblogs.com/ahdung/p/ConvertToIcon.html">https://www.cnblogs.com/ahdung/p/ConvertToIcon.html</a></p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Icon ToIcon(this Image image)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><span class="parametername">image</span></td>
        <td><p>图片</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Icon</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_ToImage_" data-uid="WQLAPI.Extensions.ImageEx.ToImage*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_ToImage_System_Byte___" data-uid="WQLAPI.Extensions.ImageEx.ToImage(System.Byte[])">ToImage(Byte[])</h4>
  <div class="markdown level1 summary"><p>Converts to image.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Image ToImage(this byte[] bytes)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Byte</span>[]</td>
        <td><span class="parametername">bytes</span></td>
        <td><p>The byte array in.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Image</span></td>
        <td><p>结果</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="WQLAPI_Extensions_ImageEx_VerticalFlip_" data-uid="WQLAPI.Extensions.ImageEx.VerticalFlip*"></a>
  <h4 id="WQLAPI_Extensions_ImageEx_VerticalFlip_System_Drawing_Bitmap_" data-uid="WQLAPI.Extensions.ImageEx.VerticalFlip(System.Drawing.Bitmap)">VerticalFlip(Bitmap)</h4>
  <div class="markdown level1 summary"><p>图像垂直翻转</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Bitmap VerticalFlip(this Bitmap image)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td><span class="parametername">image</span></td>
        <td><p>原来图像</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Drawing.Bitmap</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../../styles/docfx.js"></script>
    <script type="text/javascript" src="../../styles/main.js"></script>
  </body>
</html>
